package com.ete.service.dialog

import android.content.Context
import android.view.LayoutInflater
import androidx.annotation.ColorRes
import androidx.annotation.StringRes
import com.ete.service.service.R
import com.ete.service.service.databinding.DialogCheckVersionBinding
import com.ete.service.service.databinding.DialogMiniLoadingBinding
import com.ete.service.service.databinding.DialogMiniLoadingBindingImpl

/**
 * Author:LiXian
 * <p>
 * Desc:加载框
 * Version:1.0
 * date 2024/5/28 14:45
 */
class MiniLoadingDialog(
        mContext: Context,
        var mTip: String
): BaseDialog(mContext, R.style.XUIDialog_Custom) {

    companion object {
        @JvmStatic
        fun getMiniDialog(mContext: Context, @StringRes mTip: Int): MiniLoadingDialog {
            return MiniLoadingDialog(mContext, mContext.getString(mTip))
        }

        @JvmStatic
        fun getMiniDialog(mContext: Context, mTip: String): MiniLoadingDialog {
            return MiniLoadingDialog(mContext, mTip)
        }
    }

    init {
        val mBinding = DialogMiniLoadingBinding.inflate(LayoutInflater.from(context))
        mBinding.dialogTvTip.text = mTip
        setContentView(mBinding.root)
    }

    override fun getDialogWidthRate(): Float = 0.15F
}